<?php
/**
 *  品牌
*/

namespace app\api\model;

use think\facade\Config;

class ProductBrand extends BaseModel
{
    protected $append = ['brand_icon'];
    /**
     *  缩略图处理
     */
    public function getBrandIconAttr($value,$data)
    {

        if(isset($data['image'])){
            $arr = explode(',',$data['image']);
            if( count($arr) >= 1 ) {
                return $arr[0];
            } else {
                return '';
            }
        } else {
            return '';
        }
    }
}
